package ${model};
<#assign hasDateField = false>
<#assign hasBigDecimal = false>
<#assign isLombok = true>
<#list columnList as data>
    <#if data.varType=='Date' && !hasDateField>
        <#assign hasDateField = true>
    </#if>
    <#if data.varType=='BigDecimal' && !hasBigDecimal>
        <#assign hasBigDecimal = true>
    </#if>
</#list>

<#if isLombok>
import lombok.Data;

</#if>
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
<#if hasBigDecimal>
import java.math.BigDecimal;
</#if>
<#if hasDateField>
import java.util.Date;
</#if>

/**
 * ${tableInfo.tableComment}实体类
 *
 * @author ${author}
 * @date ${date}
 **/
<#if isLombok>
@Data
</#if>
@Table(name = "${tableInfo.tableName}")
public class ${tableInfo.className} {
<#list columnList as data>

    /**
     * ${data.columnComment}
     */
    <#if data.columnName == "ID">
    @Id
    @Column(name = "ID")
    <#else>
    @Column(name = "${data.columnName}")
    </#if>
    private ${data.varType} ${data.varName};
</#list>

<#if !isLombok>
<#list columnList as data>
    public ${data.varType} get${data.varName?cap_first}() {
        return ${data.varName};
    }

    public void set${data.varName?cap_first}(${data.varType} ${data.varName}) {
        this.${data.varName} = ${data.varName};
    }
<#if data_has_next>

</#if>
</#list>

    @Override
    public String toString() {
        return "${tableInfo.className}{" +
				<#list varNameList as fieldName>
                "${fieldName}='" + ${fieldName} + "'<#if fieldName_has_next>, </#if>" +
				</#list>
                '}';
    }
</#if>
}
